﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>公司CRM客户关系系统</title>
    <style type="text/css">
        body
        {
            margin: 0px;
            background-color: #016aa9;
            overflow: hidden;
        }
        .STYLE1
        {
            color: #000000;
            font-size: 12px;
        }
    </style>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery.showModalDialog.js" type="text/javascript"></script>
    <script type="text/javascript">
        //确保登录页面不作为框架页面显示，而是显示为独立的页面
        if (window.top != window.self) {
            window.top.location = "login.htm";
        }
        //登陆
        function OK() {
            var UserLName = $("#txtName").val();
            var UserLPWD = $("#txtPwd").val();
            if (UserLName == "" || UserLName == null) {
                alert("用户名不能为空");
                return;
            }
            else if (UserLPWD == null || UserLPWD == "") {
                alert("密码不能为空");
                return;
            }
            else {
                //收集表单数据
                var user = {
                    action: "login",
                    UserLName: UserLName,
                    UserLPWD: UserLPWD
                };
                //发起登陆请求]+
                $.post("Login.ashx", user, function (result) {
                    if (result == "1") {
                        //跳转到Main.htm
                        location.href = "Main.htm";
                    } else {
                        alert("用户名或密码错误。");
                    }
                });
            }
            
        }
    </script>
</head>
<body>
    <form id="form1">
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <table width="962" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="235" background="images/login_03.gif">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td height="53">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="394" height="53" background="images/login_05.gif">
                                        &nbsp;
                                    </td>
                                    <td width="206" background="images/login_06.gif">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="16%" height="25">
                                                    <div align="right">
                                                        <span class="STYLE1">用户</span></div>
                                                </td>
                                                <td width="57%" height="25">
                                                    <div align="center">
                                                        <input type="text" id="txtName" style="width: 105px; height: 17px; background-color: #292929;
                                                            border: solid 1px #7dbad7; font-size: 12px; color: #6cd0ff" />
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="25">
                                                    <div align="right">
                                                        <span class="STYLE1">密码</span></div>
                                                </td>
                                                <td height="25">
                                                    <div align="center">
                                                        <input type="password"  id="txtPwd" style="width: 105px; height: 17px; background-color: #292929;
                                                            border: solid 1px #7dbad7; font-size: 12px; color: #6cd0ff" />
                                                    </div>
                                                </td>
                                                <td height="25">
                                                    <div align="center">
                                                        <input type="button" style="background-image:url(images/dl.gif);border:none;width:49px;height:18px" value="" onclick="OK();" />
                                                        
                                                    </div>
                                                </td>
                                            </tr>
                                            
                                        </table>
                                    </td>
                                    <td width="362" background="images/login_07.gif">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="213" background="images/login_08.gif">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
